package homework_03;

import java.util.Scanner;

/**
 * 求位数和各位上的数字
 */
public class Test_11 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入正整数（不多于5位）");
        int num = sc.nextInt();
        int i=1;
        for (;i<6;i++){
            int m = num % 10;
            num = num / 10;
            System.out.println("右数第" + i + "位数字为" + m);
            if(num<10){
                break;
            }
        }
        System.out.println("该数字共" + i + "位");
    }
}
